package com.woniuxy.common.service;

import com.woniuxy.common.entity.Product;
import com.woniuxy.common.factory.RemoteProductServiceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/12 0012-上午 12:01
 */
@FeignClient(name = "PRODUCT",fallbackFactory = RemoteProductServiceFactory.class)//用来指定当前接口要去调用哪一个微服务的名字
public interface RemoteProductService {
    @RequestMapping("/all")
    public List<Product> all();
    @GetMapping("/hi/{name}")
    public String hi(@PathVariable("name") String name);
}
